package com.arnold.www.create;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName CreateThread_threadPool
 * @Description: 线程池创建线程
 * @Author Arnold
 * @Date 2020/4/8
 * @Version V2.0
 **/
public class CreateThread_threadPool {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newFixedThreadPool(10);
        for (int i=0;i<10;i++){
            executor.execute(new Runnable() {
                public void run() {
                    System.out.println(Thread.currentThread().getName());
                }
            });
        }
        executor.shutdown();
    }
}